/**
 *  fileName:对象添加可迭代属性
 *  time:2022/3/21
 *  todo:$END$
 */
let obj11 = {
  a:111,
  b:222
}
console.log('0000000000000')
// let arrr = [...obj11] // 会报错
obj11[Symbol.iterator] = () => {
  let keys = Object.keys(obj11)
  let len = keys.length
  let n = 0
  return {
    next(){
      if(n<len){
        n ++
        return{
          // value:{
          //   key:keys[n - 1],
          //   value:obj11[keys[n - 1]]
          // },
          value:obj11[keys[n - 1]],
          done:false
        }
      }else {
        return {
          value:null,
          done: true
        }
      }

    }
  }
}
let arrr = [...obj11]
console.log(111111111111111)
console.log(`arrr ==> `, arrr)
